import java.io.FileInputStream;
import java.util.*;


public class Simulator {
	/**
	 * Reads the text file
	 * @param fname
	 */
	public static ArrayList<String> readFile(String fname) {
		ArrayList <String>lines = new ArrayList();
		Scanner scan;
		
		try {
			System.out.println("Opening trace file :" + fname);
			scan = new Scanner(new FileInputStream(fname));			
			while(scan.hasNextLine()) {
				String line = scan.nextLine();
				lines.add(line);
			}
		} catch (Exception e) {
			System.out.println("Something went wrong while reading input file");
			e.printStackTrace();
		}
		return lines;
	}
	public static void main(String [] args) {
		ArrayList <String>lines = readFile("gcc.txt");
		Scheduler scheduler = new Scheduler(lines, 4, 8, 3, 1, 1, 1);
		scheduler.run();
		
		System.out.println(lines.get(0));
		System.out.println();
	}
}
